<?php
/********************************************************************************
 * File: sets.php
 * Desc: Displays all of your flickr sets and shows all photos in the set.
 *          Id of the set whos photos should be shown.  If none, show all sets.
 * Args: None
 ********************************************************************************/
 
require_once("inc/header.php");

if (!$config_flickrUserId)
{
   die("config_flickrUserId must be set in config.php to view sets.");
}

$sets = $f->photosets_getList($config_flickrUserId);
$photoSetData = "";

foreach ($sets['photoset'] as $set) {
   $info = $f->photos_getInfo($set['primary']);
   $photoSetData .= 
    "<a href='recent.php?setId=" . $set['id'] . "' alt='' title='" . htmlspecialchars($set['description'], ENT_QUOTES) . "'>" .
      "<img class='thumbnail' src='" . $f->buildPhotoURL($info, "Square") . "' alt='' title='" . htmlspecialchars($set['title'], ENT_QUOTES) . "::" . htmlspecialchars($set['description'], ENT_QUOTES) . "'/>" .
    "</a>";
}   
?>

<div id='page_header'>
   <span id='page_title'>Sets</span>
   <span id='page_nav'></span>
</div>

<div id='page'>
   <div id='thumbnail_container'>
      <?php echo $photoSetData; ?>
   </div>
</div>

<!-- Javascript effects -->
<script type='text/javascript' src='js/mootools.v1.11.js'></script>
<script type='text/javascript'>  
   window.addEvent('domready', function(){
      /**
      * Photo tool tip effect
      */
      var PhotoNav = new Tips($$('.thumbnail'));
   });
</script>

<?php
require_once("inc/footer.php"); 
?>
